package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GridPolicyMapper;
import com.ruoyi.system.domain.GridPolicy;
import com.ruoyi.system.service.IGridPolicyService;

/**
 * 策略管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-30
 */
@Service
public class GridPolicyServiceImpl implements IGridPolicyService 
{
    @Autowired
    private GridPolicyMapper gridPolicyMapper;

    /**
     * 查询策略管理
     * 
     * @param policyId 策略管理主键
     * @return 策略管理
     */
    @Override
    public GridPolicy selectGridPolicyByPolicyId(Integer policyId)
    {
        return gridPolicyMapper.selectGridPolicyByPolicyId(policyId);
    }

    /**
     * 查询策略管理列表
     * 
     * @param gridPolicy 策略管理
     * @return 策略管理
     */
    @Override
    public List<GridPolicy> selectGridPolicyList(GridPolicy gridPolicy)
    {
        return gridPolicyMapper.selectGridPolicyList(gridPolicy);
    }

    /**
     * 新增策略管理
     * 
     * @param gridPolicy 策略管理
     * @return 结果
     */
    @Override
    public int insertGridPolicy(GridPolicy gridPolicy)
    {
        gridPolicy.setCreateTime(DateUtils.getNowDate());
        return gridPolicyMapper.insertGridPolicy(gridPolicy);
    }

    /**
     * 修改策略管理
     * 
     * @param gridPolicy 策略管理
     * @return 结果
     */
    @Override
    public int updateGridPolicy(GridPolicy gridPolicy)
    {
        gridPolicy.setUpdateTime(DateUtils.getNowDate());
        return gridPolicyMapper.updateGridPolicy(gridPolicy);
    }

    /**
     * 批量删除策略管理
     * 
     * @param policyIds 需要删除的策略管理主键
     * @return 结果
     */
    @Override
    public int deleteGridPolicyByPolicyIds(Integer[] policyIds)
    {
        return gridPolicyMapper.deleteGridPolicyByPolicyIds(policyIds);
    }

    /**
     * 删除策略管理信息
     * 
     * @param policyId 策略管理主键
     * @return 结果
     */
    @Override
    public int deleteGridPolicyByPolicyId(Integer policyId)
    {
        return gridPolicyMapper.deleteGridPolicyByPolicyId(policyId);
    }
}
